//
//  LPTComprositionEditFooterView.m
//  LPTClient
//
//  Created by mac on 2018/12/7.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTComprositionEditFooterView.h"

@implementation LPTComprositionEditFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self initSubViews];
    }
    return self;
}

-(void)initSubViews
{
    self.backgroundColor = [UIColor clearColor];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:@"保存至我的秘方" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button.backgroundColor = kThemeOrigionColor;
    button.layer.cornerRadius = 4.0f;
    button.clipsToBounds = YES;
    [button addTarget:self action:@selector(saveAction:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:button];
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.mas_equalTo(12);
        make.trailing.mas_equalTo(-12);
        make.size.mas_equalTo(CGSizeMake(kScreenWidth - 24, 44));
        make.top.mas_equalTo(50);
    }];
}

-(void)saveAction:(UIButton *)button
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(comprositionEditFooterViewDidClickSave)]){
        [self.delegate comprositionEditFooterViewDidClickSave];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
